package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.DmSchedulerSeatPriceClientFallBack;
import cn.cs.fallback.RepairUserCilentFallBack;
import cn.cs.pojo.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = RepairUserCilentFallBack.class)
public interface RestRepairUserClient {

    @RequestMapping(value = "/createToken", method = RequestMethod.POST)
    public String createToken(@RequestParam("agent") String agent, @RequestBody RepairUser user);
    @RequestMapping(value = "/saveToken", method = RequestMethod.POST)
    public void saveToken(@RequestParam("token")String token, @RequestBody RepairUser user);
    @RequestMapping(value = "/getCerListByTypes", method = RequestMethod.POST)
    public List<Map<String,Object>> getCerListByTypes(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/insertRepairCertificateImg", method = RequestMethod.POST)
    public int insertRepairCertificateImg(@RequestBody RepairCertificateImg repImg);
    @RequestMapping(value = "/checkIdCardNum", method = RequestMethod.POST)
    public int checkIdCardNum(@RequestParam("idCard")String idCard);
    @RequestMapping(value = "/insertRepairUser", method = RequestMethod.POST)
    public int insertRepairUser(@RequestBody RepairUser user);
    @RequestMapping(value = "/getRepairCerfImgs", method = RequestMethod.POST)
    public List<RepairCertificateImg> getRepairCerfImgs(@RequestParam("id")String id);
    @RequestMapping(value = "/deleteRepairAreaById", method = RequestMethod.POST)
    public int deleteRepairAreaById(@RequestParam("id") String id);
    @RequestMapping(value = "/insertRepAreas", method = RequestMethod.POST)
    public int insertRepAreas(@RequestBody RepairUserArea repairUserArea);
    @RequestMapping(value = "/updateRepairUser", method = RequestMethod.POST)
    public int updateRepairUser(@RequestBody RepairUser newUser);
    @RequestMapping(value = "/getRepairUserByPhone", method = RequestMethod.POST)
    public RepairUser getRepairUserByPhone(@RequestParam("phone") String phone);
    @RequestMapping(value = "/checkInvitationCode", method = RequestMethod.POST)
    public int checkInvitationCode(@RequestParam("invitationCode") String invitationCode);
    @RequestMapping(value = "/getMypriLciById", method = RequestMethod.POST)
    public List<ClientUser> getMypriLciById(@RequestParam("id") String id);
    @RequestMapping(value = "/getComplaintById", method = RequestMethod.POST)
    public RepairUserComplaint getComplaintById(@RequestParam("id") String id);
    @RequestMapping(value = "/getMyComplaintNodes", method = RequestMethod.POST)
    public List<RepairUserComplaintNote> getMyComplaintNodes(@RequestParam("id") String id);
    @RequestMapping(value = "/getMyComplaint", method = RequestMethod.POST)
    public List<RepairUserComplaint> getMyComplaint(@RequestParam("id") String id);
    @RequestMapping(value = "/getCerfImgPath", method = RequestMethod.POST)
    public String getCerfImgPath(@RequestBody RepairCertificateImg repImg);
    @RequestMapping(value = "/updateCertificateImgs", method = RequestMethod.POST)
    public int updateCertificateImgs(@RequestBody RepairCertificateImg repImg);

    @RequestMapping(value = "/getPolicy", method = RequestMethod.POST)
    List<Map<String,Object>> getPolicy();

    @RequestMapping(value = "/getLastSettlement", method = RequestMethod.POST)
    RepSettlement getLastSettlement(@RequestParam("id") String id);
    @RequestMapping(value = "/insertSettOrder", method = RequestMethod.POST)
    int insertSettOrder(@RequestBody SettlementOrder settlementOrder);
    @RequestMapping(value = "/insertSett", method = RequestMethod.POST)
    int insertSett(@RequestBody RepSettlement repSettlement);

    @RequestMapping(value = "/getRepairUserArea", method = RequestMethod.POST)
    List<Map<String,Object>> getRepairUserArea(@RequestParam("id") String id);

    @RequestMapping(value = "/getRepairUserByUserId", method = RequestMethod.POST)
    public Map<String, Object> getRepairUserByUserId(@RequestParam("userId") String userId);

    @RequestMapping(value = "/getServiceTypeList", method = RequestMethod.POST)
    public List<ServiceType> getServiceTypeList();

    @RequestMapping(value = "/getFaultTypeByParentId", method = RequestMethod.POST)
    public List<FaultType> getFaultTypeByParentId(@RequestBody Map<String, Object> param);



    @RequestMapping(value = "/insertCertificateList", method = RequestMethod.POST)
    public int insertCertificateList(@RequestBody Map<String, Object> param);

    @RequestMapping(value = "/delCertificateImg", method = RequestMethod.POST)
    public int delCertificateImg(@RequestParam("id") String id);

    @RequestMapping(value = "/getRepairUserCountByMap", method = RequestMethod.POST)
    public Integer getRepairUserCountByMap(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/getRepairUserListByMap", method = RequestMethod.POST)
    public List<RepairUser> getRepairUserListByMap(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/getRepairUserDayCountByMap", method = RequestMethod.POST)
    public Integer getRepairUserDayCountByMap(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/getRepairUserDayByMap", method = RequestMethod.POST)
    public List<Map<String, Object>> getRepairUserDayByMap(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/getUserCountByPhone", method = RequestMethod.POST)
    public Integer getUserCountByPhone(@RequestParam("phone") String phone);

    @RequestMapping(value = "/getCertificateImgByUserId", method = RequestMethod.POST)
    public List<Map<String, Object>> getCertificateImgByUserId(@RequestParam("rep_user_id") String rep_user_id);

    @RequestMapping(value = "/getCertificateListByFaultId", method = RequestMethod.POST)
    public List<Map<String, Object>> getCertificateListByFaultId(@RequestParam("fault_id") String fault_id);

    @RequestMapping(value = "/updateUserOrderNumber", method = RequestMethod.POST)
    public Integer updateUserOrderNumber(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getRepairUserById", method = RequestMethod.POST)
    public RepairUser getRepairUserById(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getRepairUserAddressByAreaId", method = RequestMethod.POST)
    public Map<String,Object> getRepairUserAddressByAreaId(@RequestParam("repairUserId") String repairUserId, @RequestParam("area") String area)throws Exception;

    @RequestMapping(value = "/getRepairUserByAreaId", method = RequestMethod.POST)
    public List<Map<String,Object>> getRepairUserByAreaId(@RequestParam("area") String area)throws Exception;

    @RequestMapping(value = "/getRepairUserByLikePhone", method = RequestMethod.POST)
    public List<Map<String, Object>> getRepairUserByLikePhone(@RequestParam("phone") String phone, @RequestParam("personName") String personName)throws Exception;

    @RequestMapping(value = "/getUserNumberByAgentCode", method = RequestMethod.POST)
    public Long getUserNumberByAgentCode(@RequestParam("invitationCode") String invitationCode) throws Exception;

    @RequestMapping(value = "/getRepairAddressById", method = RequestMethod.POST)
    public Map<String, String> getRepairAddressById(@RequestParam("rep_user_id") String rep_user_id, @RequestParam("address") String address)throws Exception;
}
